<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="/resource/css/main.css" />
    <style type="text/css">
        td {
            border: solid grey 1px;
        }
    </style>

    <script type="text/javascript" src="/resource/script/jquery.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("#btnSubmit").click(function(){
                $("#trTitle").nextAll().each(function(){
                   $(this).remove();
                });
                $.post("/income/data",
                    {
                        year:$("#selYear").val(),
                        month:$("#selMonth").val(),
                        shopId:"-1"
                    },
                    function(data, status){
                        if(status == "success"){
                            if (data.result){
                                $("#trTitle").after(data.incomeData);
                            }
                            else {
                                alert(data.errorMsg);
                            }
                        }
                        else {
                            alert("网络请求出错，请重新再试！");
                        }
                    }
                );
            });

            $("#btnSubmit").click();
        });
    </script>
</head>
<body>
<div style="margin: 20px;">
    <select id="selYear">
        <option value ="2015">2015</option>
    </select>
    年
    <select id="selMonth">
        <option value ="01">1</option>
        <option value ="02">2</option>
        <option value ="03">3</option>
        <option value ="04">4</option>
        <option value ="05">5</option>
        <option value ="06">6</option>
        <option value ="07">7</option>
        <option value ="08">8</option>
        <option value ="09">9</option>
        <option value ="10">10</option>
        <option value ="11">11</option>
        <option value ="12">12</option>
    </select>
    月

    <input id="btnSubmit" type="button" value="确定" />
</div>
<div>
    <table id="tIncomeInfo" style=" border: solid grey 1px; margin-top: 30px;">
        <tr id="trTitle">
            <td width="100px">日期</td>
            <td width="150px">订单总金额</td>
            <td width="150px">真实收入</td>
            <td width="150px">优惠劵抵消</td>
        </tr>
    </table>
</div>
</body>
</html>